<template>
	<view>
		<view style="width: 100%; height: 20rpx;background: #f6f6f6;"></view>
		<view class="row-css" style="margin: 30rpx; align-items: center;text-align: center;justify-content: center;">
			<image style="width: 115rpx;height: 115rpx;border-radius: 50%;overflow:hidden;" src="../../static/icon_ecco.png"></image>
			<view style="font-size: 36rpx;margin-left: 20rpx;">提现成功</view>
		</view>
		<view class="column-css" style="padding: 20rpx 0;">
			<view class="row-css view-centent">
				<view style="width: 180rpx;">提现金额</view>
				<view>{{ parseFloat(cashrusult.amount).toFixed(2) }}(元)</view>
			</view>
			<view class="row-css view-centent">
				<view style="width: 180rpx;">提现账户</view>
				<view>{{ cashrusult.orderSerialNo }}</view>
			</view>
			<view class="row-css view-centent">
				<view style="width: 180rpx;">交易流水号</view>
				<view>{{ cashrusult.accountNo }}</view>
			</view>
		</view>
		<view class="row-css" style="width: 90%;margin: 60rpx 40rpx;">
			<button class="mini-btn" :style="{ background: category == 'true' ? '#FB8536' : '#007AFF' }" type="primary" size="default" @click="onback()">返回钱包</button>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			category: false,
			bussinessNo: '',
			cashrusult: {},
			accountNo: ''
		};
	},
	methods: {
		onback() {
			uni.navigateBack({
				delta: 1
			});
		},
		accouNo(accountNo){
			var reg = /^(\d{4})\d+(\d{4})$/;
			return accountNo.replace(reg,'$1 **** **** $2');
		}
	},
	// onUnload() {
	// 	console.log('监听返回按钮事件');
	// 	uni.navigateBack({
	// 		delta: 2
	// 	});
	// 	// this.onback();
	// },
	onLoad: function(options) {
		this.category = options.category;
		this.bussinessNo = options.bussinessNo;
		this.accountNo = options.accountNo;

		if (this.category == 'false') {
			uni.setNavigationBarTitle({
				title: '提现成功(委托收款人)' //这是修改后的导航栏文字
			});
			this.cashrusult.amount = options.amount;
			this.cashrusult.accountNo = options.accountNo;
			this.cashrusult.orderSerialNo = options.bankNo;
		}
		if (this.category == 'true') {
			//二类户
			this.wxRequest({
				url: `${this.API}/mini/erLeiHu/cashOutResult`,
				method: 'POST',
				data: {
					bussinessNo: this.bussinessNo,
					accountNo: this.accountNo
				},
				title: '提现中...',
				success: res => {
					this.cashrusult = res.data.data;
					// uni.navigateTo({
					// 	url: '../personal/withdrawsuccessfully?category=' + this.category+'&businessNo='+this.businessNo+'&accountNo='+res.data.data.accountNo
					// });
				}
			});
		} else {
			//见证宝
		}
	}
};
</script>

<style>
page {
	background: #ffffff;
	font-size: 30rpx;
}

.row-css {
	display: flex;
	flex-direction: row;
}

.column-css {
	display: flex;
	flex-direction: column;
}

.view-centent {
	padding: 20rpx 10rpx;
	flex: 1;
	margin: 0 30rpx;
}
.mini-btn {
	width: 100%;
	background: #e04b28;
	font-size: 28rpx;
	padding: 10rpx 0;
	margin: 0 20rpx;
}
</style>
